<?php
include "connection.php";

$urlWeek = $_POST["week"];
$urlAt = $_POST["at"];
$urlDate = $_POST["date"];
$urlDate2 = $_POST["date2"];
$urlAtStr = $_POST["atStr"];
$class = $_POST["class"];

$month=number_format($_POST["date3"]);
 
$tableProduct = "product";

$queryPorduct = mysql_query("select count(product_id) from $tableProduct where (week ='$urlDate' and at ='$urlAt' and month = '$month' and status ='发布' )");
$sumPorduct = mysql_result($queryPorduct, 0);

$resultPorduct = mysql_query("select * from $tableProduct where (week ='$urlDate' and at ='$urlAt' and month = '$month' and status ='发布' ) ");
while ($row = mysql_fetch_array($resultPorduct)) {
    $product_id[] = $row['product_id'];
    $product_name[] = $row['product_name'];
    $price[] = $row['price'];
}


?>

<style>
.redunum,.addnum,#pronum{ border:solid 1px #cccccc;width:30px; height:30px; display:block; float:left;line-height: 30px;
    font-weight: 700;
    text-decoration: none;
    color: #000000;}
</style>


<div class="product_list_area <?echo $class?>">
    <h2><?echo $urlDate?>日  <?echo $urlAtStr?>供应</h2>



    <table class="layui-table">
        <colgroup>
            <col width="40px" >
            <col >
            <col >
            <col >
            <col>
        </colgroup>
        <thead>
        <tr>
            <th> </th>
            <th>菜名</th>
            <th>单价(元/份)</th>
<!--            <th>可订数</th>-->
            <th width="100">数量</th>
        </tr>
        </thead>
        <tbody>


        <?for($i=0;$i<$sumPorduct;$i++){?>
            <tr class="product_list_table">
                <td><input type="checkbox" class="checkOrder" data-id="<?echo $product_id[$i]?>" data-date="<?echo $urlDate2?>" data-at="<?echo $urlAt?>" data-price="<?echo $price[$i]?>" data-num="1" ></td>
                <td><?echo $product_name[$i]?></td>
                <?// 修改数量的话，需要修改checkbox的参数和底部input的数值。一个用于临时订单显示，一个用于结算入库?>
                <td><?echo $price[$i]?> <input type="hidden" value="<?echo $price[$i]?>" class="pro_price"></td>
<!--                <td>无限制</td>-->
                <td>
                    <div id="numcontrol">
                        <a href="#" class="undo redunum" id="redunum<?echo $product_id[$i]?>" onClick="return productinfo.reduce(this)">-</a>
                        <span id="pronum"> 1 </span>
                        <input type="hidden" value="1" id="pronum-input" class="man_num orderNum" />
                        <a href="#" class="num addnum" id="addnum<?echo $product_id[$i]?>" onClick="return productinfo.plus(this);">+</a>
                    </div>
                </td>
            </tr>
        <? } ?>


        </tbody>
    </table>







</div>


